Administration Debug
argoservice Tester
argoservice Tester view
The argoservice Tester view allows you to test both basic and generic Web Service APIs within N4 without pulling on your other Web Service resources. This is designed to be a development tool and requires the DEBUG_SYSTEM privilege to access.
To test an API:
Specify the URL of the service to be tested.
If N4 is running with an application server, the URL will default to that of the current node. You can change the URL to point to an external application, such as another N4 instance, or leave blank to perform an internal test. An internal test does not use the Web Service protocol.
Enter your Username.
Enter your Password.
Enter the Scope to be used for testing.
Enter the Handler ID. This is the name of the code extension to be called in case you are using CUSTOM API messages instead of groovy scripts.
Select the Use REST API checkbox to invoke the REST service to send the request. Clear the checkbox (default) to use the SOAP web service to make the request.
In the left pane, select the Request node from the tree view.
Enter the request XML message you want to test in the field to the right.
Below the Request node are the various sub-nodes, such as GATE, GOS, EVENT, and BILLING. From these you can select specific API calls to be tested. Each call comes with a sample message that can be edited.
Execute the request by clicking either the Send Basic Request, Send Generic Request, or Send External Request button.
The Send External Request button is used when you are testing GOS calls.
The results of your request display on the right when you have the Response node, or one of its sub-nodes, selected.
For a Basic request, select the Response node.
For a Generic request, select the Results sub-node.
The Status sub-node shows the overall status of the request.
The Payload sub-node shows the XML version of the message. In addition, any errors regarding the XML entered in the Request will be listed here.
You can use the Export XSD File button to export the XSD for the selected API. When you click this button, N4 exports the XSD file of the selected Web Service request or response and a sample request XML string to the specified directory.
Notes
You must select a specific Web Service request or response to enable this button. If you select a category, such as BILLING, N4 does not enable this button.
Use argoservice Tester in the batch mode
You can also use the argoservice Tester to parse and execute multi-line Groovy scripts consisting of XML elements. The argoservice Tester supports multiple Groovy commands, file inclusion, and variable substitution. The script processor parses the input XML elements in the request by substituting variable values and expanding included files. It then executes the resulting Groovy elements in the request, and provides live status reports as part of the response.
You can use the Send Script Request button to send a multi-line Groovy script as a request. You can type or paste none or more XML script elements in the Request panel and click the Send Script Request button. When you click the Send Script Request button, N4 executes the script and displays the parsing and execution reports as it occurs.
If you click the button without specifying any XML script elements in the Request panel, N4 displays a summary of the recognized XML elements and their formats in the Response panel. The recognized XML elements are:
echo: Use it to display text in the request execution response. You can use any of the following forms of the element:
<echo text="text_message"/>
Or
<echo>
<text>text_message</text>
...
</echo>
var: Use it to define variables. The var element uses the form <var name="var_name" value="var_value"/>. Use the ${var_name} format to use the variable value in any element following the variable definition. You can use variables anywhere you would use a string such as an entity name, a command, a file name, or a folder name. The variable can in turn be used in any of the recognized elements. Variable substitution is string-based and occurs in subsequent elements, with ${var_name} being substituted with the corresponding variable value. If you re-define a variable value, all subsequent elements use the new value of the variable.
<var name="var_name" value="XXX"/>
<echo text="var_name: expected=XXX actual=${var_name}"/>
include: Use it to include a file containing predefined XML elements. The include element uses the form <include file="client_file_path"/>. The file path should be absolute.
The inclusion is in-line (any previous variables are applied) and you can nest include elements in other include elements or other elements. You can also use the var element to define file locations or file names and use the variables in the include element.
<var name="var_name" value="client_file_path\file_name.xml"/>
<include file="${var_name}"/>
Or
<include file="client_file_path\file_name.xml"/>
pause: Use it to introduce a pause into the Request element execution. The pause element uses the form <pause msec="integer_value"/>. The pause is for the specified duration, in milliseconds.
<pause msec="3000"/>
groovy: Use it to enclose individual Groovy scripts. The groovy element uses the form \<groovy\>...</groovy> and executes the Groovy scripts in the order provided.
<groovy class-location="class_location_for_the_Groovy" class-directory="class_directory_for_the_Groovy" class-name="class_name_for_the_Groovy">
<parameters>
<parameter id="param1" value="param1_value" />
<parameter id="param2" value="param2_value" />
</parameters>
</groovy>
quiet: Use it to disable subsequent element processing feedback except for the text for the echo element. N4 still provides the error and completion status. The quiet element uses the format <quiet/>, with no attributes.
verbose: Use it to enable subsequent element processing feedback, which is the default at startup. The verbose element uses the format <verbose/>, with no attributes.
The following is a sample file that uses the recognized elements defined above:
<quiet/>
<echo text="test echo attr"/>
<echo>
<text>test echo ele 1 of 2</text>
<text>test echo ele 2 of 2</text>
</echo>
<verbose/>
<var name="UNIT" value="XXX"/>
<echo text="UNIT: expected=XXX actual=${UNIT}"/>
<var name="FILE" value="SPECIFY THE PATH AND NAME OF THE FILE YOU WANT TO INCLUDE."/>
<echo text="(including file '${FILE}')"/>
<include file="${FILE}"/>
<echo text="UNIT: expected=YYY actual=${UNIT}"/>
<quiet/>
<pause msec="3000"/>
<groovy class-location="classpath" class-directory="test/extension/groovy" class-name="TestCommand">
<parameters>
<parameter id="command" value="PurgeUnit" />
<parameter id="unitId" value="${UNIT}" />
</parameters>
</groovy>
<var name="UNIT" value="ZZZ"/>
<echo text="UNIT: expected=ZZZ actual=${UNIT}"/>
<groovy class-location="classpath" class-directory="test/extension/groovy" class-name="TestCommand">
<parameters>
<parameter id="command" value="PurgeUnit" />
<parameter id="unitId" value="${UNIT}" />
</parameters>
</groovy>